package com.dreampharos.controller;
   
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.dreampharos.util.StringUtil;


@Controller
public class MemberController {


    @RequestMapping("/member")
    public ModelAndView goIntroduce(HttpServletRequest request,
			 HttpServletResponse response) {
    	
    	//session value init
    	HttpSession session     = null;

    	try {
    		session = request.getSession(true) ; 
    		String sessionCountryCode = StringUtil.nullChk((String)session.getAttribute("countryIpInfo"));

        	String nowCountryCode = StringUtil.nullChk((String)request.getParameter("lang"));
        	
        	if(!sessionCountryCode.equals(nowCountryCode)){
        		//session value update.
        		session.setAttribute("countryIpInfo",nowCountryCode);
        	}
   		
    		
    	} catch(Exception e) {
    		System.out.println(e.toString());
    	}
    	
        return new ModelAndView("member");
    }
 
}